package com.example.piece.ui.adapter

import android.view.View
import android.widget.Toast
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.piece.BR
import com.example.piece.R
import com.example.piece.databinding.ItemHomeSearchHistoryBinding
import com.example.piece.databinding.ItemSystemMsgBinding
import com.example.piece.entity.UserMessageSystemEntity

class SystemMsgAdapter :
    BaseQuickAdapter<UserMessageSystemEntity, BaseDataBindingHolder<ItemSystemMsgBinding>>(
        R.layout.item_system_msg
    ), LoadMoreModule {


    override fun convert(
        holder: BaseDataBindingHolder<ItemSystemMsgBinding>,
        item: UserMessageSystemEntity,
    ) {
        val binding =
            holder.dataBinding
        val variable = binding?.setVariable(BR.entity, item)
        binding?.setVariable(BR.adapter, this)
        binding?.setVariable(BR.position, holder.layoutPosition)
        binding?.tvRead?.visibility = if (item.isRead) View.INVISIBLE else View.VISIBLE
        binding?.executePendingBindings()
    }


}